package com.buaa.tabhost;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TabHost;

public class MainActivity extends TabActivity{
    private TabHost tabHost;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        tabHost=getTabHost();
        tabHost.addTab(tabHost.newTabSpec("系统菜单1").setIndicator("tab1",getResources().getDrawable(R.drawable.pro1)).setContent(new Intent(MainActivity.this,One.class)));
        tabHost.addTab(tabHost.newTabSpec("系统菜单2").setIndicator("tab2",getResources().getDrawable(R.drawable.pro2)).setContent(new Intent(MainActivity.this,Two.class)));
        tabHost.addTab(tabHost.newTabSpec("系统菜单3").setIndicator("tab3",getResources().getDrawable(R.drawable.pro3)).setContent(new Intent(MainActivity.this,Three.class)));
        tabHost.addTab(tabHost.newTabSpec("系统菜单4").setIndicator("tab4",getResources().getDrawable(R.drawable.pro4)).setContent(new Intent(MainActivity.this,Four.class)));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main,menu);
        return true;
    }
}
